﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using Yxinmt.Controls;
using Yxinmt.Interface;

namespace Yxinmt.Components
{
    public class StackPanelButtonComponent : BaseComponent, IComponent
    {
        StackPanelButton _StackPanelButton { get; set; }

        public StackPanelButtonComponent(Dictionary<string, object> property, IWindow window)
        {
            _Property = property;
            Window = window;
            this.InitSet();

            this.ControlList = new List<IControl>();

            _StackPanelButton = new StackPanelButton(_Property, this);
            this.ControlList.Add(_StackPanelButton);

            LoadView();
        }

        public void LoadView()
        {
            ComponentList = new List<IComponent>();
            SetView();

            if (_StackPanelButton != null) { _StackPanelButton.Clear(); this.GetComponentsElements().ForEach(c => _StackPanelButton.Add(c)); }
        }
    }
}
